#include "cell.h"
#include <algorithm>

namespace ATSudokuEngine
{

UInt32 Candidate::Size() const
{
	return (UInt32)vCandidates_.size();
}

Bool Candidate::Add(UInt32 nValue)
{
	if(Size() < nValue)
		return False;

	CandidateIterator it = std::find(vCandidates_.begin(), vCandidates_.end(), nValue);
	if(it == vCandidates_.end())
		return False;

	vCandidates_.push_back(nValue);
	return True;
}

Bool Candidate::Remove(UInt32 nValue)
{
	CandidateIterator it = std::find(vCandidates_.begin(), vCandidates_.end(), nValue);
	if(it == vCandidates_.end())
		return False;

	vCandidates_.erase(it);
	return True;
}

CandidateIterator Candidate::Remove(CandidateIterator it)
{
	return vCandidates_.erase(it);
}

}	// namespace ATSudokuEngine